package org.jeecg.modules.demo.crm.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.demo.crm.annotation.FileField;
import org.jeecg.modules.demo.crm.annotation.TitleField;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 子项目信息表
 * @Author: jeecg-boot
 * @Date:   2025-05-27
 * @Version: V1.0
 */
@Data
@TableName("c_sub_project")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="c_sub_project对象", description="子项目信息表")
public class CSubProject implements Serializable {
    private static final long serialVersionUID = 1L;

	/**id*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;
	/**项目*/
    @Excel(name = "项目", width = 15, dictTable = "c_project_application", dicText = "project_name", dicCode = "id")
    @Dict(dictTable = "c_project_application", dicText = "project_name", dicCode = "id")
    @ApiModelProperty(value = "项目")
    private String projectId;
	/**子项目名称*/
	@Excel(name = "子项目名称", width = 15)
    @ApiModelProperty(value = "子项目名称")
    @TitleField // AOP 监听文件数据，存入文件表
    private String subProjectName;
	/**子项目描述*/
	@Excel(name = "子项目描述", width = 15)
    @ApiModelProperty(value = "子项目描述")
    private String subProjectDescription;

    @ApiModelProperty(value = "权限用户")
    @Excel(name = "权限用户", width = 15, dictTable = "sys_user", dicText = "username", dicCode = "id")
    @Dict(dictTable = "sys_user", dicText = "username", dicCode = "id")
    private String userId;
    //虚拟字段
    @TableField(exist = false)
    private String userName;

    /**分包商*/
    @ApiModelProperty(value = "分包商")
    @Excel(name = "分包商", width = 15, dictTable = "c_contractor_info", dicText = "contact_name", dicCode = "id")
    @Dict(dictTable = "c_contractor_info", dicText = "contact_name", dicCode = "id")
    private String contactId;
	/**子项目状态*/
    @Excel(name = "子项目状态", width = 15, dicCode = "sub_project_status")
    @Dict(dicCode = "sub_project_status")
    @ApiModelProperty(value = "子项目状态")
    private String status;
	/**开始日期*/
	@Excel(name = "开始日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "开始日期")
    private Date startDate;
	/**结束日期*/
	@Excel(name = "结束日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "结束日期")
    private Date endDate;
	/**子项目预算*/
	@Excel(name = "子项目预算", width = 15)
    @ApiModelProperty(value = "子项目预算")
    private BigDecimal budget;
	/**相关合同文件*/
	@Excel(name = "相关合同文件", width = 15)
    @ApiModelProperty(value = "相关合同文件")
    @FileField // AOP 监听文件数据，存入文件表
    private String fileRecordId;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
	/**合计报价*/
	@Excel(name = "合计报价", width = 15)
    @ApiModelProperty(value = "合计报价")
    private BigDecimal totalQuotation;

    /**地址*/
    @ApiModelProperty(value = "地址")
    private String address;

    @ApiModelProperty(value = "项目编号")
    private String projectNumber;


    /**项目需求*/
    @ApiModelProperty(value = "项目需求")
    @Excel(name = "项目需求", width = 15, dictTable = "c_additional_request", dicText = "title", dicCode = "id")
    @Dict(dictTable = "c_additional_request", dicText = "title", dicCode = "id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//空值也会修改 null修改
    private String additionalId;


    /**附件*/
    @ApiModelProperty(value = "附件")
    @FileField // AOP 监听文件数据，存入文件表
    private String attachmentUrl;

    @ApiModelProperty(value = "删除记录")
    private Integer delFlag;

    @ApiModelProperty(value = "是否收藏")
    private Integer isFavorite;

    @Excel(name = "合同关联", width = 15, dictTable = "c_contract", dicText = "contract_no", dicCode = "id")
    @Dict(dictTable = "c_contract", dicText = "contract_no", dicCode = "id")
    @TableField(updateStrategy = FieldStrategy.IGNORED)//空值也会修改 null修改
    private String contractId;

    // 新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private String userRole;

    // 新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private BigDecimal contractPrice;

    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private String contractFile;

    /**管理库*/
    @TableField(exist = false)
    @Excel(name = "管理库", width = 15, dictTable = "c_library", dicText = "name", dicCode = "id")
    @Dict(dictTable = "c_library", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "管理库")
    private String libraryId;

    /**描述*/
    @Excel(name = "描述", width = 15)
    @ApiModelProperty(value = "描述")
    private String depict;



}
